﻿using ORS.OrderRobot.BackgroundRepeatTasker;

namespace ORS.OrderRobot
{
    /// <summary>
    /// 被调用后自动重复执行，直到满足条件后退出的任务者
    /// </summary>
    public interface IBackgroundRepeatTasker
    {
        string Key { get;}
        /// <summary>
        /// 开始执行
        /// </summary>
        /// <returns></returns>
        Task StartAsync();
        /// <summary>
        /// 重新开始执行
        /// </summary>
        /// <returns></returns>
        Task ReStartAsync();
        /// <summary>
        /// 停止执行
        /// </summary>
        /// <returns></returns>
        Task StopAsync();
        /// <summary>
        /// 暂停
        /// </summary>
        /// <returns></returns>
        Task PauseAsync();
        /// <summary>
        /// 恢复任务
        /// </summary>
        /// <returns></returns>
        Task ResumeAsync();

        /// <summary>
        /// 获取任务状态
        /// </summary>
        /// <returns></returns>
        TaskInfo TaskInfo { get; }

    }
}